package com.onetech.adrewards.free.dialogs;

import android.app.Activity;

import com.onetech.adrewards.free.R;
import com.onetech.adrewards.free.activities.BaseNewActivity.ExitHandler;
import com.zuzu.dialogs.BaseDialog;

public class ExitAppDialog extends BaseDialog {
	private Activity activity = null;
	private ExitHandler mAdHandler=null;
	public ExitAppDialog(Activity context, ExitHandler _handler) {
		super(context, context.getString(R.string.dialog_exit_app_title),
				TYPE_2_BUTTON, R.layout.dialog_exit_confirm_layout);
		activity = context;
		setNegativeButtonTitle(R.string.dialog_exit_app_btn_Cancel);
		setPositiveButtonTitle(R.string.dialog_exit_app_btn_Ok);
		setDefaultButtonTitle(R.string.dialog_exit_app_btn_Ok);
		mAdHandler=_handler;
		setOnDialogListener(new OnDialogListener() {
			@Override
			public void onPositiveButtonClicked() {
				//activity.finish();
				dismiss();
				mAdHandler.doExit();
			}

			@Override
			public void onNegativeButtonClicked() {
				dismiss();
			}

			@Override
			public void onDefaultButtonClicked() {
				dismiss();
			}
		});
	}
}
